home *** CD-ROM | disk | FTP | other *** search
/ The Original Shareware 1.1 / The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso / 15 / marylamb.zip / LIBAUX.ASM next >
Assembly Source File  |  1986-03-06  |  2KB  |  143 lines

  1. ;-------------------------------------------------------
  2. ;
  3. ;  Windows start up module
  4. ;
  5. if1
  6.     ?WINLIBC = 0
  7.     ?PASCAL = 0
  8.     ifndef ?PASLIBW
  9.     ifndef ?MLIBW
  10.         ifndef ?SLIBW
  11.         ?WINLIBC = 1
  12.         ifndef ?MLIB
  13.             memS = 1
  14.             %out ! Compiling for WINLIBC.LIB
  15.         else
  16.             memM = 1
  17.             %out ! Compiling for MWINLIBC.LIB/LWINLIBC.LIB
  18.         endif
  19.         else
  20.         memS = 1
  21.         %out ! Compiling for SLIBW.LIB
  22.         endif
  23.     else
  24.         memM = 1
  25.         %out ! Compiling for MLIBW.LIB/LLIBW.LIB
  26.     endif
  27.     else
  28.     ?PASCAL = 1
  29.     memM = 1
  30.     %out ! Compiling for PASLIBW.LIB
  31.     endif
  32.     ifndef ?OEMLIBC
  33.     ?LIBOEM = 0
  34.     else
  35.     ?LIBOEM = 1
  36.     %out ! Compiling for OEMLIBC.LIB
  37.     endif
  38. endif
  39.  
  40.     .xlist
  41.     ?PLM = 1;
  42.     ?WIN = 1;
  43.     include cmacros.inc
  44.     .list
  45.  
  46.  
  47. sBegin        DATA
  48. assumes DS,DATA
  49.  
  50. public    __acrtused
  51.     __acrtused = 1
  52.  
  53. if SizeC
  54. globalCP    __aaltstkovr,-1    ;
  55. endif
  56.  
  57.  
  58. sEnd        DATA
  59.  
  60. externFP    <FATALEXIT>
  61.  
  62. sBegin    CODE
  63. assumes CS,CODE
  64.  
  65.     PUBLIC    __chkstk,_chkstk,chkstk
  66. __chkstk:
  67. _chkstk:
  68. chkstk:
  69.     pop    bx
  70. if sizeC
  71.     pop    dx
  72. endif
  73.     sub    ax,sp
  74.     neg    ax
  75. chkstk1:
  76.     mov    sp,ax
  77. if sizeC
  78.     push    dx
  79.     push    bx
  80. ccc    proc    far
  81.     ret
  82. ccc    endp
  83. else
  84.     jmp    bx
  85. endif
  86.  
  87. labelNP <PUBLIC,__astkovr>
  88.     mov    al,-1
  89.     db    0BBh
  90.  
  91. labelNP <PUBLIC,__cintDIV>
  92.     mov    al,-2
  93.     db    0BBh
  94.  
  95. labelNP <PUBLIC,__fptrap>
  96.     mov    al,-3
  97.  
  98.     cbw
  99.     cCall    FATALEXIT,<ax>
  100. sEnd    CODE
  101.  
  102. ife  ?WINLIBC
  103.  
  104. externFP   <main>
  105.  
  106. sBegin    CODE
  107. assumes CS,CODE
  108.  
  109. cProc __astart,<PUBLIC,FAR>
  110. cBegin
  111.     ;;
  112.     ;; DS = automatic data segment.
  113.     ;; CX = size of heap.
  114.     ;; DI = module handle.
  115.     ;; ES:SI = address of command line (not used).
  116.     ;;
  117.     push    es
  118.     push    si
  119.     push    di
  120.     push    cx
  121.     push    ds
  122.     mov    si,sp
  123.  
  124.     mov    ax,5
  125.     regptr    argv,ss,si        ; SS != DS.
  126.     ;;cCall __cinit         ; Not called because all "C" librarys
  127.                     ; assume ss == ds.
  128.     ;
  129.     ; main( argc, argv )
  130.     ;
  131.     cCall    main,<ax,argv>
  132.  
  133.     add    sp,10            ; Pop parameters to __astart.
  134. cEND    __astart
  135.  
  136. sEnd    CODE
  137.  
  138. end __astart
  139.  
  140. endif        ; ife ?WINLIBC
  141.  
  142. end ENTRY
  143.